<template>
	<view class="center-box">
		<!-- <header-box :title="'title'"></header-box> -->

		<view class="header" style="color: #000000;">

			<u-tabs height="88" font-size="34" inactive-color="#717171" gutter="126" active-color="#9885F8" :list="list"
			 :is-scroll="false" :current="current" @change="change">
			</u-tabs>
		</view>


		<!-- <view class="search-box ww100 h68 pl22 pr22" style="background-color: #FFFFFF;">
			<u-search height="68" placeholder="搜索关键词...." :show-action="false" v-model="keyword">
			</u-search>
		</view> -->

		<!-- v-for="(item,index) in arrList" :key="index"  -->
		<block v-if="current == 0" v-for="(item,index) in arrList" :key="index">

			<view class="box-cent ">
				<view class="w546 h155 bgc-imag">
				</view>
				<view class="center-top pt80 r20">
					<view class="img" @tap="goback(item)">
						<image class="w120 h120 r60 " :src="item.avatar" mode=""></image>
						<view class="pl21">
							{{item.staff_name}}
							<view class="center">
								负责人
							</view>
						</view>

					</view>

					<view class="tab-list flex">
						<view class="w200">庆典公司名称：</view><text style="color: #232323;">{{item.company_name}}</text>
					</view>
					<view class="tab-list flex">
						<view class="w200">活动日期：</view><text style="color: #232323;">{{item.activity_time}}</text>
					</view>
					<view class="tab-list flex">
						<view class="w200">
							活动地址：
						</view><text style="color: #232323;">{{item.activity_address}}</text>
					</view>
					<!-- <view class="tab-list flex">
						<view class="w200">
							活动类型：
						</view><text style="color: #232323;">舞会</text>
					</view> -->
					<view class="tab-list flex">
						<view class="w200">
							进场时间：
						</view>
						<text style="color: #232323;">{{item.createtime }}</text>
					</view>


					<view class="tab-list flex">
						<view class="w200">
							联系人：
						</view><text style="color: #232323;">{{item.person_name}}</text>
					</view>
					<view class="tab-list flex align-center justify-between">
						<view class="flex align-center">
							<view class="w200">
								联系人电话：
							</view>
							<text style="color: #232323;">{{item.phone}}</text>
						</view>
						<view class="" @tap="phone(item.phone)"><text class="cuIcon-copy mr10"></text> 复制</view>
					</view>

					<view class="tab-list flex align-center justify-between">
						<view class="">
							参与人员：
							<view class="cu-avatar-image cu-avatar-group">
								<view class="cu-avatar round lg" v-for="(item1,index) in item.staff_ids" :key="index" :style="[{ backgroundImage:'url(' + item1.avatar + ')'}]">

								</view>

							</view>
						</view>
					</view>
					<view class="tab-list1 flex align-center">
						<view class="" style=" width: 210rpx;">
							设备：
						</view>
						<view class="flex flex-wrap">
							<text class="cu-tag bg-red light r10 f-1  mt26 " v-for="(item1,index) in item.equipment_ids" :key="index">{{item1}}</text>
						</view>
					</view>
				</view>
			</view>
		</block>


		<block v-for="(item,index) in arrList" v-if="current == 1" :key="index">
			<view class="ww100 center-text " style="background-color: #FFFFFF;" @tap="goBack2(item)">
				<view class="ww100 flex align-center pl22 pr22 pt30 flex mb20">
					<view class="">
						<image class="w120 h120 r60 mr22" src="../../static/VIP_tu.png" mode=""></image>
					</view>
					<view class="wh100 lh60">
						<view class="ww100 flex align-center justify-between">

							<view class="fn-text" style="fw">
								{{item.name}}

								<view class="bgc1">
									负责人: {{item.staff_name}}
								</view>
							</view>
							<view class="" style="color: #999999;">
								<view class="w300" style=" white-space: nowrap;text-overflow:ellipsis;overflow: hidden;">
									{{item.flow_name}}
								</view>
								<text>{{item.createtime}}</text>
							</view>
						</view>
					</view>
				</view>
				<view class="ww100 h20" style="background-color: #F7F7F7;">
				</view>
			</view>
		</block>




		<yy-home></yy-home>

		<view class="foot_box"></view>
		<!-- 加载提示 -->
		<yy-loading text="加载中.." mask="true" click="true" ref="loading"></yy-loading>
		<!-- 信息提示-->
		<u-toast ref="uToast" />
	</view>
</template>

<script>
	export default {
		data() {
			return {
				keyword: '',
				list: [{
					name: '当前订单'
				}, {
					name: '我的审核'
				}],
				current: 0,
				arrList: [],
			};
		},
		onShow() {
			if (this.current == 0) {
				this.arrList = []
				this.getStockList()
			} else {
				this.arrList = []
				this.getCheckList()
			}
			
		},
		onLoad(e) {
			this.getStockList()
		},
		methods: {
			clkOn() {
				this.z.load(this);
				setTimeout(() => {
					this.z.load(this, 0);
				}, 3000);
			},

			change(index) {
				this.current = index;
				if (index == 0) {
					this.arrList = []
					this.getStockList()
				} else {
					this.arrList = []
					this.getCheckList()
				}
			},

			// 列表
			async getStockList() {
				const res = await this.$u.post("api/process/index?user_id=" + uni.getStorageSync(
					'uid')) //   uni.getStorageSync('uid')
				this.arrList = res.data
				if (res.code != 1) {
					this.$tools.msg('你没有权限,请申请!')
				}
			},

			// 列表
			async getCheckList() {
				const res = await this.$u.post("api/process/flow_user_sure?user_id=" + uni.getStorageSync(
					'uid')) //   uni.getStorageSync('uid')
				this.arrList = res.data
			},

			goBack2(item) {
				
				uni.navigateTo({
					url: '/pages/flow/filltab?process_id=' + item.process_id + '&flow_id=' + item.flow_id +
						'&info=' + 88 + "&fu_status=" + item.fu_status
				})
				

			},

			goback(item) {
				console.log(item) // status == 2
				uni.setStorageSync('staff_id', item.staff_id)
				uni.setStorageSync('flow_step', item.id)
				// 流程完成
				if (item.status == 2) {
					uni.navigateTo({
						url: '/pages/flow/stepList?id=' + item.id + '&text=' + 88
					})
					// 未完成
				} else {
					this.$tools.to('/pages/flow/order?id=' + item.id)
				}
			}
		}
	};
</script>

<style lang="scss" scoped>
	.center-box {
		width: 100%;
		height: 100%;
		background-color: #9885F8;



		.header {
			width: 100%;
			height: 160rpx;
			line-height: 160rpx;
			// display: flex;
			// align-items: center;
			// padding-left: 10rpx;
			padding-top: 60rpx;
			font-size: 36rpx;
			font-family: PingFang SC;
			font-weight: 500;
			background: #FFFFFF;
			justify-content: center;
		}

		.search-box {
			margin: 0 auto;
			background-color: #FFFFFF;
		}

		.bgc-imag {
			position: absolute;
			left: 50%;
			transform: translate(-50%);
			top: 1%;
			background-size: 100%;
			background-repeat: no-repeat;
			background-image: url('https://w-jinxiao.oss-cn-chengdu.aliyuncs.com/20210322/142.png');
		}

		.box-cent {
			padding-bottom: 100rpx;
			padding-top: 90rpx;
			background-color: #9885F8;
			position: relative;
			// left: 10%;
			// top: 8%;
			// background-size: 100%;
			// background-repeat: no-repeat;
			// background-image: url('https://w-jinxiao.oss-cn-chengdu.aliyuncs.com/20210322/142.png');



			.center-top {
				width: 706rpx;
				// height: 860rpx;
				margin: 0rpx auto;
				padding-bottom: 50rpx;
				background-color: #FFFFFF;

				.img {
					margin-top: 44rpx;
					padding-left: 24rpx;
					padding-right: 21rpx;
					display: flex;

					.center {
						width: 110rpx;
						// height: 38rpx;
						margin: 14rpx auto;
						color: #FFFFFF;
						text-align: center;
						line-height: 38rpx;
						border-radius: 19rpx;
						font-size: 24rpx;
						background-color: #FF9F42;
					}
				}

				.tab-list1 {
					width: 92%;
					// height: 98rpx;
					// line-height: 98rpx;
					margin: 0 auto;
					color: #999999;
					// padding-bottom: 32rpx;
				}

				.tab-list {
					width: 92%;
					height: 80rpx;
					line-height: 80rpx;
					margin: 0 auto;
					color: #999999;
					border-bottom: 1rpx solid #F7F7F7;
				}

				.tab-list1 {
					width: 92%;
					margin: 0 auto;
					color: #999999;
					padding-bottom: 32rpx;
				}
			}


			// .center-top1 {
			// 	width: 706rpx;
			// 	// height: 562rpx;
			// 	// margin: 38rpx auto 0;
			// 	background-color: #FFFFFF;

			// 	.tab-list {
			// 		width: 92%;
			// 		height: 120rpx;
			// 		line-height: 120rpx;
			// 		margin: 0 auto;
			// 		color: #999999;
			// 		border-bottom: 1rpx solid #F7F7F7;
			// 	}

			// 	.tab-list1 {
			// 		width: 92%;
			// 		margin: 0 auto;
			// 		color: #999999;
			// 		padding-bottom: 32rpx;
			// 	}
			// }

		}




		.fn-text {
			font-size: 30rpx;
			font-weight: 700;
			color: #232323;
			font-family: PingFang SC;
		}

		.bgc {
			color: #FFFFFF;
			text-align: center;
			font-size: 24rpx;
			border-radius: 30rpx;
			padding: 0 10rpx;
			// background: #FF9F42;
		}

		.bgc1 {
			// width: 110rpx;
			padding: 7rpx 20rpx;
			color: #FFFFFF;
			text-align: center;
			font-size: 24rpx;
			border-radius: 34rpx;
			background: #FF9F42;
		}

		.text-fs {
			font-size: 26rpx;
			font-family: PingFang SC;
			font-weight: 500;
			color: #717171;
		}

		.back-btn {
			position: fixed;
			top: 200rpx;
			right: 0;
			width: 130rpx;
			height: 50rpx;
			display: flex;
			align-items: center;
			background: #FFFFFF;
			padding-left: 19rpx;
			font-size: 26rpx;
			border-radius: 25px 0px 0px 25px;
			box-shadow: 0px 3px 46px 0px rgba(0, 0, 0, 0.16);
		}
	}
</style>
